import 'package:appflutterhomeschool/provider/provider_widget.dart';
import 'package:appflutterhomeschool/res/colors.dart';
import 'package:appflutterhomeschool/res/styles.dart';
import 'package:appflutterhomeschool/ui/widgets/general_page_jump_widget.dart';
import 'package:appflutterhomeschool/ui/widgets/my_app_bar.dart';
import 'package:appflutterhomeschool/view_model/my/set_up_view_model.dart';
import 'package:flutter/material.dart';

///用户： ninetailedfox
///时间： 2020/6/26
///邮箱： 1037438704@qq.com
///功能： 设置页面
class SetUpPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ProviderWidget<SetUpViewModel>(
      model: SetUpViewModel(context),
      onModelReady: (value) => value.initView(),
      builder: (context, viewModel, child) {
        return Scaffold(
          backgroundColor: Colours.gray_f6,
          appBar: MyAppBar2(title: "设置"),
          body: Column(
            children: <Widget>[
              GeneralPageJumpWidget(
                margin: EdgeInsets.only(bottom: 10),
                title: "个人资料",
                onTap: () => viewModel.initEvent(0),
              ),
              GeneralPageJumpWidget(
                margin: EdgeInsets.only(bottom: 1),
                title: "修改密码",
                onTap: () => viewModel.initEvent(1),
              ),
              GeneralPageJumpWidget(
                margin: EdgeInsets.only(bottom: 10),
                title: "修改绑定手机号",
                rightContent: viewModel.getPhone,
                textRightStyle: TextStyles.textDark36,
                onTap: () => viewModel.initEvent(2),
              ),
              GeneralPageJumpWidget(
                title: "关于我们",
                onTap: () => viewModel.initEvent(3),
              ),
            ],
          ),
        );
      },
    );
  }
}
